package com.bywlkjs.common.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.json.JSONObject;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.io.Serializable;

/**
 * 这是一个方便用户在rest操作的工具类
 * @author 方某人
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class RestResult<T> implements Serializable {

    private Integer state;
    private String msg;
    private String errMsg;
    private T data;

    public RestResult(Integer state) {
        this.state = state;
    }

    public RestResult(Integer state, T data) {
        this.state = state;
        this.data = data;
    }

}
